package dd.lo.chapter2;

import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.highgui.HighGui;
import org.opencv.imgcodecs.Imgcodecs;

public class Example1 {

    public static void main(String[] args) {
        System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
        Mat imgMat = Imgcodecs.imread("/Users/kwok/Downloads/avatar.jpeg", Imgcodecs.IMREAD_UNCHANGED);
        if (imgMat.empty()) {
            throw new RuntimeException("图片读取失败");
        }
        String windowName = "Example1";
        HighGui.imshow(windowName,imgMat);
        HighGui.waitKey(0);
        HighGui.destroyWindow(windowName);
    }
}
